package com.broadsword.publishers;

import com.broadsword.entities.MyEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;


@Component
public class MyApplicationPublisher {

    @Autowired
    private ApplicationEventPublisher publisher;

    public void publishEvent(String message) {
        MyEvent myEvent = new MyEvent((ApplicationContext) this,message);
        publisher.publishEvent(myEvent);
    }

}
